<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>msm</title>
		<link href="<%=path%>/css/base.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/frame.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/jquery-tree-1.1.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
			var path = "<%=path%>";
		</script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-1.6.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-jtemplates.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.metadata.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.validate.fixed.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/config/config.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/util.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/jquery-tree-1.1.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/oacore.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/accountBook.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/init.js"></script>
		<script type="text/javascript">
			$(function(){
				//radio checkbox 等值改变的时候出发change()
				$(":radio").change(function(){
					$.ajax({
						url:path+"/ajax/setSmsFlagAction.action",
						type:"post",
						data:{
							id:this.id,
							flg:this.value
						},
						success:function(data){
							var showFlag = data.flg==true?"已录入":"未录入";
							$("#flag_"+data.id).text(showFlag);
						}
					});
				});
			});
		</script>
	</head>
	<body>
		<table border="" cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<td width="100">来信号码</td>
					<td width="300">短信内容</td>
					<td width="100">接收时间</td>
					<td width="100">标志位</td>
					<td width="100">是否录入</td>
				</tr>
			</thead>
			
			<tbody>
				<s:iterator value="smsPage.result" status="step">
					<tr> 
						<td><s:property value="sendNum"/></td>
						<td><s:property value="message"/></td>
						<td><s:property value="receiveTime"/></td>
						<td id="flag_<s:property value="smsReceiveId"/>">
							<s:if test="flg==true">已录入</s:if>
							<s:else>未录入</s:else>
						</td>
						<td>
							<s:if test="flg == true">
								<input id='<s:property value="smsReceiveId"/>' type="radio" name="flg[${step.index }]" value="true" checked="checked"/>是
								<input id='<s:property value="smsReceiveId"/>' type="radio" name="flg[${step.index }]" value="false"/>否
							</s:if>
							<s:else>
								<input id='<s:property value="smsReceiveId"/>' type="radio" name="flg[${step.index }]" value="true"/>是
								<input id='<s:property value="smsReceiveId"/>' type="radio" name="flg[${step.index }]" value="false" checked="checked"/>否
							</s:else>
						</td>
					</tr>
				</s:iterator>
			</tbody>	
		</table>
	</body>
</html>